home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 015a / bsltools.zip / A2B next >
Text File  |  1992-08-21  |  1KB  |  61 lines

  1. PATH=/bin:/etc:/usr/bin
  2. SHELL=/bin/sh
  3. export PATH SHELL
  4. OK=0
  5. FAIL=1
  6. ###############################################################################
  7. #
  8. #        Prompt for yes or no answer - returns non-zero for no
  9. #
  10. getyn() {
  11.     while echo "$* (y/n)? \c" >&2
  12.     do    read yn rest
  13.         case $yn in
  14.             [Yy])    return $OK    ;;
  15.             [Nn])    return $FAIL    ;;
  16.             *)    echo "\n\t Please answer y or n" >&2
  17.             ;;
  18.         esac
  19.     done
  20. }
  21. ###############################################################################
  22. #
  23. #        Remove the adaptec scsi host driver from the mscsi file
  24. #
  25. removedvr() {
  26.     cd /etc/conf/cf.d
  27.     echo "\t Changing ad mscsi entry to btk"
  28.     mv mscsi mscsi.old
  29.     sed "s/^ad/btk/" mscsi.old > mscsi
  30.     chmod 644 mscsi
  31.     chgrp sys mscsi
  32.     rm mscsi.old
  33. #
  34. #        Change the Y to N for the adaptec sdevice entry
  35. #        Can't use configure 'cuz there is no major no.
  36. #
  37.     cd /etc/conf/sdevice.d
  38.     echo "\t Switching ad driver off in sdevice.d"
  39.     mv ad ad.old
  40.     sed "s/^Y/N/" ad.old >ad
  41.     chmod 644 ad
  42.     chgrp sys ad
  43.     rm ad.old
  44. }        
  45. #################################################################################
  46. #        Main
  47. #
  48. [ -z "`grep \^ad /etc/conf/cf.d/mscsi`" ] || {
  49.     echo "\t The Adaptec driver ad is configured in the mscsi file "
  50.     getyn "\n\t Would you like to replace ad with btk" && {
  51.         [ -x /bin/sed ] || {
  52.             echo "ERROR: /bin/sed missing: exiting "
  53.             exit 1
  54.         }
  55.         removedvr
  56.         echo "\t You will need to relink the kernel for the"
  57.         echo "\t changes to take effect."
  58.     }
  59. }
  60. exit 0
  61.